Public Class ReportFunctionsLinkCtrl
    Inherits System.Web.UI.UserControl

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents lnkHelp As System.Web.UI.WebControls.LinkButton
    Protected WithEvents lnkExport As System.Web.UI.WebControls.LinkButton
    Protected WithEvents lnkDownloadCSV As System.Web.UI.WebControls.LinkButton
    Protected WithEvents lnkDownloadCSV2 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents lblDownloadCSV As System.Web.UI.WebControls.Label
    Protected WithEvents lblDownloadCSV2 As System.Web.UI.WebControls.Label

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Public Event ExportClick()
    Public Event DownloadCSVClick()
    Public Event DownloadCSV2Click()



    Public Property DownloadCSVVisible() As Boolean
        Get
            Return Me.lblDownloadCSV.Visible
        End Get
        Set(ByVal Value As Boolean)
            Me.lblDownloadCSV.Visible = Value
        End Set
    End Property

    Public Property DownloadCSV2Visible() As Boolean
        Get
            Return Me.lblDownloadCSV2.Visible
        End Get
        Set(ByVal Value As Boolean)
            Me.lblDownloadCSV2.Visible = Value
        End Set
    End Property


    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Not Page.IsPostBack Then

            'Me.litLink.Text = String.Format("<a href=""{0}"">::Print</a> | <a href=""{1}"">::Export to Excel</a> | <a href=""{2}"">::Help</a>", Me.PrintURL, Me.Export2ExcelURL, Me.HelpURL)

        End If
    End Sub

    Protected Function GetPrintURL() As String
        Return Request.Url.AbsolutePath.Replace(".aspx", "_Print.aspx")
    End Function

    Protected Function GetHelpURL() As String
        Dim ss() As String = Request.Url.AbsolutePath.Split("/"c)
        Return AppRoot() & "/Help/" & ss(ss.Length - 1).Replace(".aspx", "_Help.htm")
    End Function

    Private Sub lnkExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lnkExport.Click
        RaiseEvent ExportClick()
    End Sub

    Private Sub lnkDownloadCSV_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lnkDownloadCSV.Click
        RaiseEvent DownloadCSVClick()
    End Sub


    Private Sub lnkDownloadCSV2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkDownloadCSV2.Click
        RaiseEvent DownloadCSV2Click()
    End Sub
End Class
